#include <AST/expr/literal/CharAST.hpp>
#include <global.hpp>

Char::Char(char val) : val(val) {
    // TODO
    cachedValue = llvm::ConstantInt::get(getType(), val, false);
}

llvm::Type *Char::getType() {
    return BasicType::CharTy;
}

llvm::Constant *Char::codegen() {
    return static_cast<Constant *>(cachedValue);
}

llvm::Value *Char::getDefault() {
    return llvm::ConstantInt::get(BasicType::CharTy, 0, false);
}
